Skip to content

fix(types): use correct default export#901

Open
plushdohn wants to merge 1 commit intoporsager:masterfrom
plushdohn:master
Open

fix(types): use correct default export#901
plushdohn wants to merge 1 commit intoporsager:masterfrom
plushdohn:master

Conversation

@plushdohn
Copy link
Copy Markdown

This PR fixes #862 by ensuring classes defined under the postgres namespace aren't also available as a named export, but only under the default postgres. export.

I've tested the change by patching the module in my projects, but I'm not sure if under some specific Typescript scenarios the behaviour could be incorrect.


Trying to import PostgresError as a named export:

Screenshot 2024-06-24 at 12 30 01

And here's the correct usage using the default export:

Screenshot 2024-06-24 at 12 31 14

@gdaybrice
Copy link
Copy Markdown

Would like this one merged please 👍

@porsager
Copy link
Copy Markdown
Owner

Needs some more thumbs up from other typescript users to confirm this doesn't break anything? (i don't use typescript so can't tell)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect type definitions causing confusion when trying to catch PostgresError

3 participants